import requests
from lxml import html
url='https://www.qiushibaike.com/8hr/page/1/' #需要爬的网址
page=requests.Session().get(url)
tree=html.fromstring(page.text)
result=tree.xpath("//div[@class='recommend-article']//li") #需要获取的数据
# result1=tree.xpath('//tr//a/@href')
# result2=tree.xpath('//tr[last()]//a/@href')
print(result)
# print(result1)
# print(result2)